<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数学类</title>
</head>
<body>
<script>
    console.log(Math.PI)  //圆周率
   console.log( Math.ceil(3.14)) //向上取整  4
    console.log(Math.floor(3.14)) //向下取整 3
    console.log(Math.round(3.14)) //3  四舍五入
    console.log(Math.round(3.54)) //4  四舍五入
    console.log(Math.random())   //获取一个0-1之间的随机数

    console.log("---------------------------")

    let num = Math.random()  //0-1
    num = num * 10  // 0 - 10

    console.log(Math.floor(num+1))


</script>
</body>
</html>